#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QStack>
#include <QKeyEvent>

QT_BEGIN_NAMESPACE
namespace Ui {
class MainWindow;
}
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

protected:
    void keyPressEvent(QKeyEvent *event) override;

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

    QString operand;//操作数
    QString opcode;
    QStack<QString>operands;
    QStack<QString>opcodes;

    QString calculation(bool clearContainers);

private slots:


    void btnNumClicked();

    void on_btnPoint_clicked();

    void on_btnDelete_clicked();

    void btnBinaryOperatorClicked();
    void btnUnaryOperatorClicked();

    void on_btnC_clicked();
    void on_btnCE_clicked();

    void on_btnEquals_clicked();

private:
    Ui::MainWindow *ui;
};
#endif // MAINWINDOW_H
